<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>{$GLOBALS['cfg_webname']}-用户注册</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
       <meta name="description" content="会员中心">
    <meta name="author" content="歪酷CMS">
     <link href="__PUBLIC__/User/css/bootstrap.min.css" rel="stylesheet">
    <style type="text/css">
      body {
        padding-top: 60px;
        padding-bottom: 40px;
      }
      .sidebar-nav {
        padding: 9px 0;
      }
    </style>
    <link href="__PUBLIC__/User/css/bootstrap-responsive.min.css" rel="stylesheet"/>
  </head>
  <body>
	<include file="Public:head"/>
    <div class="container-fluid">
      <div class="row-fluid">
        <include file="Public:left"/>
		<div class="span9">
		<div class="navbar">
		<div class="navbar-inner">
		<a class="brand">会员注册</a>
		</div>
		</div>
		</div>
        <div class="span9" style='border:1px solid #ccc;margin-bottom:10px;'>
		<div style="padding:20px">
		<form class="form-horizontal" name="UserReg" action="{:U('Public/doreg')}" onsubmit="return CheckForm()" method="post">
		<div class="control-group">
			<label class="control-label" for="inputEmail">用户名</label>
			<div class="controls">
				<input type="text" name="username" id="username" placeholder="输入用户名..."/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label" for="inputEmail">邮箱</label>
			<div class="controls">
				<input type="text" name="email" id="email"  placeholder="输入邮箱地址.."/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label" for="inputEmail">密码</label>
			<div class="controls">
				<input type="password" name="password" id="password" placeholder="输入密码..."/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label" for="inputEmail">确认密码</label>
			<div class="controls">
				<input type="password" name="repassword" id="repassword" placeholder="输入密码..."/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label" for="inputEmail">性别</label>
			<div class="controls">
				<select name="sex" id="sex">
				<option value='0'>女</option>
				<option value='1'>男</option>
				</select>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label" for="inputEmail">生日</label>
			<div class="controls">
				<script type="text/javascript" src="__PUBLIC__/Admin/setdate/WdatePicker.js"></script>
				<input name='birthday' id="birthday" type='text' class="borderall" onFocus="WdatePicker({isShowClear:false,readOnly:true,startDate:'1988-01-23',minDate:'1960-01-01',maxDate:'2012-12-31',skin:'whyGreen'})"/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label" for="inputEmail">籍贯</label>
			<div class="controls">
				<select onChange="setcity();" name='province' id="province">
    <option value=''>请选择省份</option>
    <option value="广东">广东</option>
    <option value="北京">北京</option>
    <option value="重庆">重庆</option>
    <option value="福建">福建</option>
    <option value="甘肃">甘肃</option>
    <option value="广西">广西</option>
    <option value="贵州">贵州</option>
    <option value="海南">海南</option>
    <option value="河北">河北</option>
    <option value="黑龙江">黑龙江</option>
    <option value="河南">河南</option>
    <option value="香港">香港</option>
    <option value="湖北">湖北</option>
    <option value="湖南">湖南</option>
    <option value="江苏">江苏</option>
    <option value="江西">江西</option>
    <option value="吉林">吉林</option>
    <option value="辽宁">辽宁</option>
    <option value="澳门">澳门</option>
    <option value="内蒙古">内蒙古</option>
    <option value="宁夏">宁夏</option>
    <option value="青海">青海</option>
    <option value="山东">山东</option>
    <option value="上海">上海</option>
    <option value="山西">山西</option>
    <option value="陕西">陕西</option>
    <option value="四川">四川</option>
    <option value="安徽">安徽</option>
    <option value="台湾">台湾</option>
    <option value="天津">天津</option>
    <option value="新疆">新疆</option>
    <option value="西藏">西藏</option>
    <option value="云南">云南</option>
    <option value="浙江">浙江</option>
    <option value="海外">海外</option>
  </select> <select name='city' id="city"></select><script charset="utf-8" src="__PUBLIC__/Admin/js/getcity.js"></script><script>initprovcity('','');</script>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label" for="inputEmail">QQ</label>
			<div class="controls">
				<input type="text" name="qq" id="qq" placeholder="QQ号码.."/>
			</div>
		</div>
		<?php if(C('SOFT_VERIFY') <>1):?>
		<div class="control-group">
			<label class="control-label" for="inputEmail">验证码</label>
			<div class="controls">
				<input class="input-mini" type="text" name="verify" id="verify" style="text-transform:uppercase;"/><img src="{:U('Public/verify?rand=')}{:uniqid()}" alt="看不清楚请点击刷新验证码" style="cursor : pointer;border:1px solid #ccc;margin-left:2px;" onclick="show(this)"/>
			</div>
		</div>
		<?php endif;?>
		<div class="control-group">
			<div class="controls">
				<button type="submit" class="btn btn-primary btn-large">注册</button>&nbsp;
				<button type="reset" class="btn btn-inverse btn-large">重置</button>
			</div>
		</div>
		</form></div>
		</div><!--/span-->
      

	 </div><!--/row-->
		

      <hr/>

      <include file="Public:footer"/>

    </div>
<script>
function show(obj){
obj.src="{:U('Public/verify?random=1')}"+ Math.random();
}
	function CheckForm()
	{ 
		if(EmptyCheckForm('username','用户名不能为空!','')) return false;
		if(EmptyCheckForm('password','密码不能为空!',''))return false;
		if(EmptyCheckForm('repassword','确认密码不能为空!',''))return false;
		if(EmptyCheckForm('birthday','生日不能为空!',''))return false;
		if(EmptyCheckForm('province','省份不能为空!',''))return false;
		if(EmptyCheckForm('city','城市不能为空!',''))return false;
		if(EmptyCheckForm('email','邮箱不能为空!',''))return false;
		if(EmailCheckForm('email','邮箱格式不正确!'))return false;
		if(QQCheckForm('qq','qq号码不正确!'))return false;
		if(RepwdCheckForm('password','repassword','确认密码和密码不一致!'))return false;
		<?php if(C('SOFT_VERIFY') <>1):?>
		if(EmptyCheckForm('verify','验证码不能为空!',''))return false;
		<?php endif;?>
	}
	function EmptyCheckForm(id,value,set)
	{
		if($('#'+id).val()==set)
		{
			$.dialog({icon:'warning',content:value,ok:function(){ $('#' + id).focus();}});return true;
		}
		return false;
	}
	
   function EmailCheckForm(id,msg)
   { 
		var szReg=/^[A-Za-z0-9]+([-_.][A-Za-z0-9]+)*@([A-Za-z0-9]+[-.])+[A-Za-z0-9]{2,5}$/; 
		Mail = $('#'+id).val();
		if(szReg.test(Mail)==false)
		{
			$.dialog({icon:'warning',content:msg,ok:function(){ $('#' + id).focus();}});return true;
		}
		return false;
	} 
	function QQCheckForm(id,msg)
	{ 
		var szReg=/^[1-9][0-9]{4,12}$/; 
		Mail = $('#'+id).val();
		if(szReg.test(Mail)==false)
		{
			$.dialog({icon:'warning',content:msg,ok:function(){ $('#' + id).focus();}});return true;
		}
		return false;
	} 
	function RepwdCheckForm(id1,id2,msg)
	{
		if($('#'+id1).val() != $('#'+id2).val())
		{
			$.dialog({icon:'warning',content:msg,ok:function(){ $('#' + id1).focus();}});return true;
		}
		return false;
	}
</script>
	<script charset="utf-8" src="__PUBLIC__/Common/Jquery/Jquery.js"></script>
	<script charset="utf-8" src="__PUBLIC__/Common/artDialog/jquery.artDialog.js?skin=twitter"></script>
	<script charset="utf-8" src="__PUBLIC__/Common/artDialog/extend.js"></script>  
  </body>
</html>
